﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace AMAP.Areas.Supplier.Models.Offer
{
    public class SupplierOfferCreateViewModel
    {
        public ICollection<OfferItem> ItemList { get; set; }
        public int FruitId { get; set; }
        public SelectList FruitList { get; set; }
        public int VegetableId { get; set; }
        public SelectList VegetableList { get; set; }
        public int OtherId { get; set; }
        public SelectList OtherList { get; set; }
    }

    public class OfferItem
    {
        public int ProductId { get; set; }

        [Required]
        [Display(Name = "Unité", Prompt = "Unité")]
        [MaxLength(50)]
        public string Unit { get; set; }

        [Required]
        [Display(Name = "Prix")]
        public double Price { get; set; }

        [Required]
        [Display(Name = "Quantité")]
        public double Quantity { get; set; }

        [Required]
        [Display(Name = "HarvestDate")]
        public DateTime HarvestDate { get; set; }
    }
}